#include <memory>
#include "TcpServer.hpp"

static void Usage(const std::string& proc)
{
    std::cout << "usage\n" << proc << " serverport\n" << std::endl; 
}

int main(int argc, char** argv)
{
    if(argc != 2)
    {
        Usage(argv[1]);
        exit(USAGEERROR);
    }
    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<TcpServer> svr(new TcpServer(port));
    svr->init();
    svr->start();
    return 0;
}